﻿<!DOCTYPE html>
<%@taglib uri="/struts-tags" prefix="s" %>
<html lang="en"><!-- Source is http://themes.loxdesign.net/phoenix/forms_elements.html -->
    <head>
        <meta charset="utf-8">
        <title>Company Roles</title>

        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <meta name="apple-mobile-web-app-capable" content="yes" />
        <meta name="description" content="">
        <meta name="author" content="">

        <!-- ===================== Touch Icons ===================== -->
        <link rel="shortcut icon" href="styles/Controls/favicon.ico">
        <link rel="apple-touch-icon-precomposed" sizes="144x144" href="styles/Controls/apple-touch-icon-144-precomposed.png">
        <link rel="apple-touch-icon-precomposed" sizes="114x114" href="styles/Controls/apple-touch-icon-114-precomposed.png">
        <link rel="apple-touch-icon-precomposed" sizes="72x72" href="styles/Controls/apple-touch-icon-72-precomposed.png">
        <link rel="apple-touch-icon-precomposed" href="styles/Controls/apple-touch-icon-57-precomposed.png">

        <!-- ===================== CSS ===================== -->

        <link rel="stylesheet" href="styles/Controls/forms_elements_files/bootstrap.min.css">
        <link rel="stylesheet" href="styles/Controls/forms_elements_files/bootstrap-responsive.min.css">

        <!-- Site specific - CSS -->
        <link rel="stylesheet" href="styles/Controls/forms_elements_files/prettify.css">
        <link rel="stylesheet" href="styles/Controls/forms_elements_files/jquery-ui-1.8.20.custom.css">
        <link rel="stylesheet" href="styles/Controls/forms_elements_files/chosen.css">
        <link rel="stylesheet" href="styles/Controls/forms_elements_files/dropkick.css">
        <link rel="stylesheet" href="styles/Controls/forms_elements_files/multi-select.css">
        <link rel="stylesheet" href="styles/Controls/forms_elements_files/jquery.ibutton.css">

        <!-- Common - CSS -->
        <link rel="stylesheet" href="styles/Controls/forms_elements_files/common.css">
        <link rel="stylesheet" href="styles/Controls/forms_elements_files/theme_light.css" class="style_set">

        <script type="text/javascript">


            function addRow(tableID) {
                var table = document.getElementById(tableID);
                var rowCount = table.rows.length;
                var row = table.insertRow(rowCount);
                var counts = rowCount - 1;

                //======= 1 of 6=====================
                var cell1 = row.insertCell(0);
                var checker = document.createElement("input");
                checker.type = "checkbox";
                checker.name = "chbox[" + counts + "]";
                cell1.appendChild(checker);

                //==========2 of 6===================
                var cell2 = row.insertCell(1);
                var company = document.createElement("SELECT");
                company.type = "";
                company.name = "companyRole.roleForm[" + counts + "].companyModuleSid";
                company.id = counts + "id";
                cell2.appendChild(company);
            <s:iterator value="companyModules" var="i">
                    var option = document.createElement('option');
                    option.value = "<s:property value="#i.modules.moduleSid"/>";
                    option.appendChild(document.createTextNode("<s:property value="#i.moduleTitle"/>"));
                    company.appendChild(option);
            </s:iterator>
                    company.onclick = function() {
                        var id = this.value;
                        $.ajax({
                            type: "GET",
                            url: "getForms",
                            data: "data=" + id,
                            success: function(data, textStatus, XMLHttpRequest) {
                                $("#" + counts).html(data);


                            },
                            error: function(XMLHttpRequest, textStatus, errorThrown) {

                                alert(textStatus);
                            }
                        });

                    };
                    //===================3 of 6 ====================
                    var cell3 = row.insertCell(2);
                    var from = document.createElement("SELECT");
                    from.type = "";
                    from.name = "companyRole.roleForm[" + counts + "].formId";
                    from.id = counts;
                    cell3.appendChild(from);
                    //======================4 of 6 ===================
                    var cell4 = row.insertCell(3);
                    var add = document.createElement("input");
                    add.type = "checkbox";
                    add.name = "companyRole.roleForm[" + counts + "].add";
                    add.id = "companyRole.roleForm[" + counts + "].add";
                    add.onchange = function(event) {
                        if (add.checked) {
                            add.value = "true";

                        }
                    };
                    cell4.appendChild(add);
                    //==================================5 of 6==================

                    var cell5 = row.insertCell(4);
                    var update = document.createElement("input");
                    update.type = "checkbox";
                    update.name = "companyRole.roleForm[" + counts + "].update";
                    update.id = "companyRole.roleForm[" + counts + "].update";
                    update.onchange = function(event) {
                        if (update.checked) {
                            update.value = "true";

                        }
                    };
                    cell5.appendChild(update);
                    //====================================6 of 6 =======================
                    var cell6 = row.insertCell(5);
                    var del = document.createElement("input");
                    del.type = "checkbox";
                    del.name = "companyRole.roleForm[" + counts + "].delete";
                    del.id = "companyRole.roleForm[" + counts + "].delete";
                    del.onchange = function(event) {
                        if (del.checked) {
                            del.value = "true";

                        }
                    };
                    cell6.appendChild(del);
                    //=======================================7 of 9=========
                    var cell7 = row.insertCell(6);
                    var approve = document.createElement("input");
                    approve.type = "checkbox";
                    approve.name = "companyRole.roleForm[" + counts + "].approve";
                    approve.id = "companyRole.roleForm[" + counts + "].approve";
                    approve.onchange = function(event) {
                        if (approve.checked) {
                            approve.value = "true";

                        }
                    };
                    cell7.appendChild(approve);
                    //==============================8 of 9 ===============
                    var cell8 = row.insertCell(4);
                    var Active = document.createElement("input");
                    Active.type = "checkbox";
                    Active.name = "companyRole.roleForm[" + counts + "].Active";
                    Active.id = "companyRole.roleForm[" + counts + "].Active";
                    Active.onchange = function(event) {
                        if (Active.checked) {
                            Active.value = "true";

                        }
                    };
                    cell8.appendChild(Active);
                    //=======9 of 9=================================
                    var cell9 = row.insertCell(8);
                    var button = document.createElement("a");
                    button.title = "Delete";
                    button.innerHTML = button.title;
                    button.href = "#";

                    cell9.appendChild(button);

                }

                function addRow2(tableID) {
                    var table = document.getElementById(tableID);
                    var rowCount = table.rows.length;
                    var row = table.insertRow(rowCount);
                    var counts = rowCount - 1;

                    //======= 1 of 6=====================
                    var cell1 = row.insertCell(0);
                    var checker = document.createElement("input");
                    checker.type = "checkbox";
                    checker.name = "chbox[" + counts + "]";
                    cell1.appendChild(checker);

                    //==========2 of 6===================
                    var cell2 = row.insertCell(1);
                    var company = document.createElement("SELECT");
                    company.type = "";
                    company.name = "companyRole.roleReport[" + counts + "].companyModuleSid";
                    company.id = counts + "id";
                    cell2.appendChild(company);
            <s:iterator value="companyModules" var="i">
                    var option = document.createElement('option');
                    option.value = "<s:property value="#i.modules.moduleSid"/>";
                    option.appendChild(document.createTextNode("<s:property value="#i.moduleTitle"/>"));
                    company.appendChild(option);
            </s:iterator>
                    company.onclick = function() {
                        var id = this.value;
                        $.ajax({
                            type: "GET",
                            url: "getReports",
                            data: "data=" + id,
                            success: function(data, textStatus, XMLHttpRequest) {
                                $("#" + counts).html(data);


                            },
                            error: function(XMLHttpRequest, textStatus, errorThrown) {

                                alert(textStatus);
                            }
                        });

                    };
                    //===================3 of 6 ====================
                    var cell3 = row.insertCell(2);
                    var from = document.createElement("SELECT");
                    from.type = "";
                    from.name = "companyRole.roleReport[" + counts + "].reportId";
                    from.id = counts;
                    cell3.appendChild(from);
                    //======================4 of 6 ===================
                    var cell4 = row.insertCell(3);
                    var add = document.createElement("input");
                    add.type = "checkbox";
                    add.name = "companyRole.roleReport[" + counts + "].view";
                    add.id = "companyRole.roleReport[" + counts + "].view";
                    add.onchange = function(event) {
                        if (add.checked) {
                            add.value = "true";

                        }
                    };
                    cell4.appendChild(add);
                    //==================================5 of 6==================

                    var cell5 = row.insertCell(4);
                    var print = document.createElement("input");
                    print.type = "checkbox";
                    print.name = "companyRole.roleReport[" + counts + "].print";
                    print.id = "companyRole.roleReport[" + counts + "].print";
                    print.onchange = function(event) {
                        if (print.checked) {
                            print.value = "true";

                        }
                    };
                    cell5.appendChild(print);
                    //====================================6 of 6 =======================
                    var cell6 = row.insertCell(5);
                    var schedule = document.createElement("input");
                    schedule.type = "checkbox";
                    schedule.name = "companyRole.roleReport[" + counts + "].schedule";
                    schedule.id = "companyRole.roleReport[" + counts + "].schedule";
                    schedule.onchange = function(event) {
                        if (schedule.checked) {
                            schedule.value = "true";

                        }
                    };
                    cell6.appendChild(schedule);
                    //=======================================7 of 9=========
                    var cell7 = row.insertCell(6);
                    var active = document.createElement("input");
                    active.type = "checkbox";
                    active.name = "companyRole.roleReport[" + counts + "].active";
                    active.id = "companyRole.roleReport[" + counts + "].active";
                    active.onchange = function(event) {
                        if (active.checked) {
                            active.value = "true";

                        }
                    };
                    cell7.appendChild(active);

                    //=======8 of 8=================================
                    var cell8 = row.insertCell(7);
                    var button = document.createElement("a");
                    button.title = "Delete";
                    button.innerHTML = button.title;
                    button.href = "#";

                    cell8.appendChild(button);

                }

        </script>

    </head>
    <body>
        <div id="loader_cont">
            <img src="styles/Controls/forms_elements_files/page_loader.gif"></div>

        <div class="navbar navbar-fixed-top">
            <div class="navbar-inner">
                <div class="container">
                    <a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
                        <span class="sweet-gray sweet-go-back-from-screen">&nbsp;</span>
                    </a>
                    <div class="nav-collapse">
                        <ul class="nav main_nav" role="navigation">
                            <li id="mail" class="styled dropdown mail">
                                <a class="dropdown-toggle" data-toggle="dropdown" href="#">Mail<span class="info">2</span></a>
                                <ul class="dropdown-menu top_menu">
                                    <li><a class="mn_new_msg" href="mail.html"><span>New Message</span></a></li>
                                    <li><a class="mn_inbox" href="mail.html"><span>Inbox</span></a></li>
                                    <li><a class="mn_outbox" href="mail.html"><span>OutBox</span></a></li>
                                    <li><a class="mn_spam" href="mail.html"><span>Spam</span></a></li>
                                    <li><a class="mn_trash" href="mail.html"><span>Trash</span></a></li>
                                </ul>
                            </li>
                            <li id="chat" class="styled chat">
                                <a data-toggle="modal" href="#chat_modal">Chat<span class="info">5</span></a>
                            </li>
                            <li id="notification" class="styled dropdown notification">
                                <a class="dropdown-toggle" data-toggle="dropdown" href="#">Notification<span class="info">4</span></a>
                                <ul class="dropdown-menu">
                                    <li>
                                        <a href="#">
                                            Lorem ipsum dolor sit amet, consectetur adipiscing elit...
                                            <span>07/19/2012</span>
                                        </a>
                                    </li>
                                    <li>
                                        <a href="#">
                                            Vivamus ut enim vitae nibh aliquet pre-tium lobortis sit amet tortor...
                                            <span>07/19/2012</span>
                                        </a>
                                    </li>
                                    <li>
                                        <a href="#">
                                            Ut id dui arcu, non tempus nunc...
                                            <span>07/19/2012</span>
                                        </a>
                                    </li>
                                    <li>
                                        <a href="#">
                                            Morbi faucibus suscipit nibh, ut pellen-tesque lectus pellentesque non....
                                            <span>07/19/2012</span>
                                        </a>
                                    </li>
                                    <li class="show_all"><a href="#">Show all notifications</a></li>
                                </ul>
                            </li>
                        </ul>
                        <ul class="main_nav nav pull-right">
                            <li id="search" class="search">
                                <a href="#">Search</a>
                                <div class="search_cont">
                                    <form class="navbar-search form-search">
                                        <input type="text" class="input-medium search-query" placeholder="Search">
                                        <button type="submit">Search</button>
                                    </form>
                                </div>
                            </li>
                            <li id="settings" class="styled dropdown settings">
                                <a class="dropdown-toggle" data-toggle="dropdown" href="#">Settings</a>
                                <ul class="dropdown-menu top_menu">
                                    <li class="show_all">Settings</li>
                                    <li><a class="mn_site" href="#"><span>Site</span></a></li>
                                    <li><a class="mn_admin" href="#"><span>Admin</span></a></li>
                                    <li><a class="mn_mail" href="#"><span>Mail</span></a></li>
                                    <li><a class="mn_user" href="#"><span>User</span></a></li>
                                </ul>
                            </li>
                            <li id="profile" class="styled dropdown profile">
                                <a class="dropdown-toggle" data-toggle="dropdown" href="#">Profile</a>
                                <ul class="dropdown-menu top_menu">
                                    <jsp:include page="parts/profilecombo.jsp"/>
                                </ul>
                            </li>
                        </ul>
                    </div>
                    <h1 class="brand"><a href="index.html">PHOENIX</a></h1>
                </div>
            </div>
        </div>

        <div class="container">
            <div class="main_content row-fluid">

                <div class="span3">

                    <div class="side_nav sidebar-nav" data-spy="affix" data-offset-top="150">
                        <h3 class="main_menu group">
                            <span class="title">Main Menu</span>
                            <a id="nav_list_btn" class="btn-collapse btn btn-inverse">
                                <span class="sweet-gray sweet-go-back-from-screen">&nbsp;</span>
                            </a>
                        </h3>
                        <jsp:include page="parts/dashboard.jsp"/>
                    </div><!--/.well -->
                </div><!--/span-->
                <div class="span9">
                    <div class="row-fluid">
                        <div class="span12">

                            <div class="span12 no_space">

                                <div class="widget">
                                    <header>
                                        <h3>Company Roles</h3>
                                        <ul class="toggle_content">
                                            <li class="arrow">&nbsp; <a href="#">Toggle Content</a></li>
                                        </ul>
                                    </header>
                                    <section class="welly uniform_styled form_align">
                                        <div class="row-fluid">
                                            <table style="width:100%">
                                                <tr>
                                                    <td style="width: 140px">Role Code:</td>
                                                    <td><input type="text" name="text" style="width:120px"></td>
                                                    <td colspan="2"><input type="checkbox"/>
                                                        Active Record</td>

                                                </tr>
                                                <tr  style="height:5px">
                                                    <td colspan="4"></td>
                                                </tr>

                                                <tr><td style="width: 140px">Role Name:</td>
                                                    <td colspan="3">
                                                        <input type="text" name="text"></td>


                                                </tr>
                                                <tr  style="height:5px">
                                                    <td colspan="4"></td>
                                                </tr>

                                                <tr>
                                                    <td style="width: 140px">Role Description:</td>
                                                    <td colspan="3"><textarea style="width: 350px; height: 68px"></textarea></td>
                                                </tr>
                                                <tr  style="height:5px">
                                                    <td colspan="4"></td>
                                                </tr>

                                                <tr>
                                                    <td style="width: 140px">Comments:</td>
                                                    <td colspan="3">
                                                        <textarea style="width: 350px; height: 68px"></textarea>
                                                    </td>
                                                </tr>
                                            </table>
                                        </div>


                                    </section>

                                    <ul class="nav nav-tabs tab_styled_dark">
                                        <li class="active"><a href="#home_2" data-toggle="tab">Role Forms</a></li>
                                        <li><a href="#portfolio_2" data-toggle="tab">Role Reports</a></li>
                                    </ul>
                                    <div class="tab-content tab_content_dark">
                                        <div id="home_2" class="tab-pane fade active in">
                                            <div class="widget table_basic_header">
                                                <header>
                                                    <h3>Role Forms details</h3>
                                                    <ul class="toggle_content">
                                                        <li class="arrow"><a href="#">Toggle Content</a></li>
                                                    </ul>
                                                </header>
                                                <section class="welly uniform_styled">
                                                    <div class="row-fluid">
                                                        <input type="button" value="Add New Record" onclick="addRow('roleform');">
                                                    </div>
                                                </section>
                                                <section>
                                                    <table id="roleform" class="table_basic chbox css">
                                                        <thead>
                                                            <tr>
                                                                <td><input name="chbox" type="checkbox" value=""></td>
                                                                <td>Module Name</td>
                                                                <td>Form Name</td>
                                                                <td>Add</td>
                                                                <td>Update</td>
                                                                <td>Delete</td>
                                                                <td>Approve</td>
                                                                <td>Active</td>
                                                                <td></td>
                                                            </tr>
                                                        </thead>
                                                        <tbody>


                                                        </tbody>
                                                    </table>
                                                </section>
                                            </div>

                                        </div>
                                        <div id="portfolio_2" class="tab-pane fade">
                                            <div class="widget table_basic_header">
                                                <header>
                                                    <h3>Role Reports details</h3>
                                                    <ul class="toggle_content">
                                                        <li class="arrow"><a href="#">Toggle Content</a></li>
                                                    </ul>
                                                </header>
                                                <section class="welly uniform_styled">
                                                    <div class="row-fluid">
                                                        <input type="button" value="Add New Record" onclick="addRow2('rolereport');">
                                                    </div>
                                                </section>
                                                <section>
                                                    <table id="rolereport" class="table_basic chbox css">
                                                        <thead>
                                                            <tr>
                                                                <td style="text-align:center"><input name="chbox" type="checkbox" value=""></td>
                                                                <td>Module Name</td>
                                                                <td>ReportName</td>
                                                                <td style="text-align:center">View</td>
                                                                <td style="text-align:center">Print</td>
                                                                <td style="text-align:center">Scheduale</td>
                                                                <td style="text-align:center">Active</td>
                                                                <td></td>
                                                            </tr>
                                                        </thead>
                                                        <tbody>



                                                        </tbody>
                                                    </table>
                                                </section>
                                            </div>

                                        </div>
                                    </div>
                                    <section class="welly uniform_styled">
                                        <div class="row-fluid">
                                            <input type="submit" value="Save">
                                            <input type="reset" value="Reset">
                                        </div>
                                    </section>

                                </div>


                            </div>

                        </div>
                    </div><!--/row-->

                </div><!--/span-->
            </div><!--/row-->

            <footer>
                <p>&copy; Infolink URS 2013</p>
            </footer>

        </div><!--/.fluid-container-->

        <!-- ===================== CHAT - Modal ===================== -->
        <div id="chat_modal" class="chat_modal modal fade hide">
            <div class="modal-header">
                <ul>
                    <li class="toggle_users"><a href="#">Show Users</a></li>
                    <li class="status">
                        <a class="online" href="#"><span>Status</span></a>
                        <ul>
                            <li><a class="online" href="#" title="Online"><span>Online</span></a></li>
                            <li><a class="away" href="#" title="Away"><span>Away</span></a></li>
                            <li><a class="busy" href="#" title="Busy"><span>Busy</span></a></li>
                            <li><a class="invisiblee" href="#" title="Invisible"><span>Invisible</span></a></li>
                            <li><a class="offline" href="#" title="Offline"><span>Offline</span></a></li>
                        </ul>
                    </li>
                    <li class="chat_name">John Doe</li>
                </ul>
                <button type="button" class="close" data-dismiss="modal">x</button>
            </div>
            <div class="modal-body">
                <div class="msg_cont left">
                    <img src="styles/Controls/forms_elements_files/user_1.jpg" width="50" height="50" alt="User">
                    <ul>
                        <li>
                            <h3>John Doe:</h3>
                            <span>16 minutes ago</span>
                        </li>
                        <li>Aliquam iaculis volutpat ipsum ullamcorper tempus. In in dui tortor. Mauris sed volutpat
                            metus. Duis ut sapien sapien, id pellentesque orci. Nullam nisl metus, sodales ut laoreet
                            eget, pretium porttitor quam. Sed varius vulputate lacinia. </li>
                    </ul>
                </div>
                <div class="msg_cont right">
                    <img src="styles/Controls/forms_elements_files/user_2.jpg" width="50" height="50" alt="User">
                    <ul>
                        <li>
                            <h3>Jessie Doe:</h3>
                            <span>16 minutes ago</span>
                        </li>
                        <li>Aliquam iaculis volutpat ipsum ullamcorper tempus. In in dui tortor. Mauris sed volutpat
                            metus. Duis ut sapien sapien, id pellentesque orci. Nullam nisl metus, sodales ut laoreet
                            eget, pretium porttitor quam. Sed varius vulputate lacinia. </li>
                    </ul>
                </div>
                <div class="msg_cont left">
                    <img src="styles/Controls/forms_elements_files/user_1.jpg" width="50" height="50" alt="User">
                    <ul>
                        <li>
                            <h3>John Doe:</h3>
                            <span>16 minutes ago</span>
                        </li>
                        <li>Aliquam iaculis volutpat ipsum ullamcorper tempus. In in dui tortor. Mauris sed volutpat
                            metus. Duis ut sapien sapien, id pellentesque orci. Nullam nisl metus, sodales ut laoreet
                            eget, pretium porttitor quam. Sed varius vulputate lacinia. </li>
                    </ul>
                </div>
            </div>
            <div class="modal-footer">
                <textarea></textarea>
                <a href="#" class="btn btn-inverse">Send</a>
            </div>
        </div>

        <!-- ===================== JS ===================== -->
        <script src="styles/Controls/forms_elements_files/jquery-1.7.2.min.js"></script>
        <script src="styles/Controls/forms_elements_files/bootstrap.min.js"></script>
        <script src="styles/Controls/forms_elements_files/ios-orientationchange-fix.js"></script>
        <script src="styles/Controls/forms_elements_files/jquery-ui-1.8.20.custom.min.js"></script>
        <script src="styles/Controls/forms_elements_files/common.js"></script>

        <!-- Site specific - JS -->
        <script src="styles/Controls/forms_elements_files/prettify.js"></script>
        <script src="styles/Controls/forms_elements_files/jquery.maskedinput-1.3.min.js"></script>
        <script src="styles/Controls/forms_elements_files/chosen.jquery.min.js"></script>
        <script src="styles/Controls/forms_elements_files/scrollability.min.js"></script>
        <script src="styles/Controls/forms_elements_files/jquery.dropkick-1.0.0.js"></script>
        <script src="styles/Controls/forms_elements_files/jquery.multi-select.js"></script>
        <script src="styles/Controls/forms_elements_files/jquery.quicksearch.js"></script>
        <script src="styles/Controls/forms_elements_files/jquery.autogrowtextarea.js"></script>
        <script src="styles/Controls/forms_elements_files/jquery.textareaCounter.plugin.js"></script>
        <script src="styles/Controls/forms_elements_files/ui.spinner.min.js"></script>
        <script src="styles/Controls/forms_elements_files/jquery.ibutton.min.js"></script>
        <script src="styles/Controls/forms_elements_files/jquery.metadata.js"></script>

        <script src="styles/Controls/forms_elements_files/script.js"></script>
        <script src="styles/Controls/forms_elements_files/forms_elements.js"></script>

        <script type="text/javascript">

                var _gaq = _gaq || [];
                _gaq.push(['_setAccount', 'UA-31818910-2']);
                _gaq.push(['_setDomainName', 'loxdesign.net']);
                _gaq.push(['_trackPageview']);

                (function() {
                    var ga = document.createElement('script');
                    ga.type = 'text/javascript';
                    ga.async = true;
                    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
                    var s = document.getElementsByTagName('script')[0];
                    s.parentNode.insertBefore(ga, s);
                })();

        </script>
    </body>
</html>